//
//  ZSY_SearchEndModel.m
//  ZSY_BreadTrip
//
//  Created by 张诗宇 on 16/1/7.
//  Copyright © 2016年 张诗宇. All rights reserved.
//

#import "ZSY_SearchEndModel.h"

@implementation ZSY_SearchEndModel


- (void)dealloc {
    [_userss release];
    [_tripss release];
    [super dealloc];
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key {
    if ([key isEqualToString:@"users"]) {
        for (NSDictionary *dic in value) {
            ZSY_SearchUserModel *model = [[ZSY_SearchUserModel alloc] init];
            [model setValuesForKeysWithDictionary:dic];
            [self.userss addObject:model];
            [model release];
        }

    }
    if ([key isEqualToString:@"trips"]) {
        for (NSDictionary *dic in value) {
            ZSY_SearchTripModel *model = [[ZSY_SearchTripModel alloc] init];
            [model setValuesForKeysWithDictionary:dic];
            [self.tripss addObject:model];
            [model release];
        }
    }
    
}

- (instancetype)init {
    self = [super init];
    if (self) {
        self.userss = [NSMutableArray array];
        self.tripss = [NSMutableArray array];
    }
    return self;
}



@end
